<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="/common_head :: commonHead('pie')"></head>
<body>
<div class="page-container">
    <div class="left-content">
        <div class="inner-content">
            <div class="header-section">
                <div th:include="/header :: header"></div>
                <div class="clearfix"></div>
            </div>
            <div class="outter-wp">
                <div class="sub-heard-part">
                    <ol class="breadcrumb m-b-0">
                        <li><a href="index.html">Home</a></li>
                        <li class="active">File</li>
                    </ol>
                </div>
            </div>
            <div class="graph-visual">
                <h2 class="inner-tittle">个人信息/h2>
                <div class="graph">
                    <div class="graph">
                        <div class="tables">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>账户</th>
                                    <th>密码</th>
                                    <th>昵称</th>
                                    <th>角色</th>
                                    <!--<th>操作</th> -->
                                </tr>
                                </thead>
    <!--
                                <form method="post" action="/updateInfo">
                                    <div id="dialog" style="display: none;">
                                        <div class="weui-mask">

                                        </div>
                                        <div class="weui-dialog">

                                            <label for="nNickname">账户：</label>
                                            <input type="text"id ="nAccount" name="nAccount" />

                                            <label for="nNickname">密码：</label>
                                            <input type="text"id ="nPassword" name="nPassword" />

                                            <label for="nNickname">昵称：</label>
                                            <input type="text"id ="nNickname" name="nNickname" />


                                            <label for="nRole">角色：</label>
                                            <input type="text" id="nRole" name = "nRole"/>

                                            <input type="submit" id="submit" value="确认" />
                                        </div>
                                    </div>
                                </form>
    -->

                                <tbody>
                                <tr if="${user}">
                                    <td><label th:text="${user.getAccount()}"></label></td>
                                    <td><label th:text="${user.getPassword()}"></label></td>
                                    <td><label th:text="${user.getNickname()}"></label></td>
                                    <td><label th:text="${user.getRole()}"></label></td>
                                    <!--<td id="showDialog">修改个人资料</td> -->
                                </tr>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <footer th:include="/footer :: footer">
                </footer>
            </div>
        </div>
        <div class="sidebar-menu" th:include="/sidebar :: sidebar"></div>
        <div class="clearfix"></div>
    </div>
</div>
<script>

    <!--$(function() {
        var $dialog = $('#dialog');
        //任何li被点击，整个父元素dialogs都淡出
        $('#dialog').on('click', '#submit', function() {
            $dialog.fadeOut(200);
        });

        //点击头像，召唤弹窗
        $('#showDialog').on('click', function() {
            $dialog.fadeIn(200);
        });
    }); -->


    $("#upload").click(function () {
        var form=new FormData();
        form.append("file", $("#file")[0].files[0]);
        $.ajax({
            type:"post",
            url: "uploadFile",
            data:form,
            processData: false,  // 告诉jQuery不要去处理发送的数据
            contentType: false,   // 告诉jQuery不要去设置Content-Type请求头
            success: function(data){
                alert(data);
                window.location.href="/file";
            },
        })
    })
</script>
</body>
</html>